(function () {
    'use strict';

    angular.module('app')
        .controller('ScheduleJobLogListCtrl', ScheduleJobLogListCtrl);

    ScheduleJobLogListCtrl.$inject = ['$rootScope', '$scope', 'ScheduleJobLogService'];
    function ScheduleJobLogListCtrl($rootScope, $scope, scheduleJobLogService) {

		$scope.title = '定时任务日志';
		$scope.params = {
            pageNum: 1,
            pageSize: 20,
            orderBy: ''
        };

		$scope.search = function () {
			$rootScope.loading = true;
            scheduleJobLogService.list($scope.params)
                .then(function (data) {
					$scope.pageInfo = data;
                })
                .finally(function () {
					$rootScope.loading = false;
                })
            ;
        };

			$scope.search();

		$scope.pageChanged = function () {
			$scope.params.pageNum = $scope.pageInfo.pageNum;
				$scope.search();
        };
    }
})();